package com.wxb.quartz.service.impl;


import com.wxb.quartz.dao.PayRecordMapper;
import com.wxb.quartz.model.PayRecord;
import com.wxb.quartz.service.PayRecordService;
import com.wxb.quartz.util.GenericDao;
import com.wxb.quartz.util.GenericServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * describe:
 *
 * @author : 王校兵
 * @version : v1.0
 * @time : 2017/6/21  14:13
 */
@Service
public class PayRecordServiceImpl extends GenericServiceImpl implements PayRecordService {

    @Autowired
    private PayRecordMapper dao;

    /**
     * 定义成抽象方法,由子类实现,完成dao的注入
     *
     * @return GenericDao实现类
     */
    @Override
    public GenericDao getDao() {
        return this.dao;
    }

    /**
     * 根据orderId查询对应的订单详情
     *
     * @param orderId 订单id
     * @return PayRecord对象
     */
    @Override
    public PayRecord findByOrderId(String orderId) {
        return dao.findByOrderId(orderId);
    }

    /**
     * 查询所有未支付订单
     */
    @Override
    public List<PayRecord> findWaitPayOrder() {
        return dao.findWaitPayOrder();
    }
}
